Crate postgresql_archive
source ·Expand description
§postgresql_archive
Retrieve and extract PostgreSQL on Linux, MacOS or Windows.
§Table of contents
§Examples
§Asynchronous API
use postgresql_archive::{extract, get_archive, Result, LATEST};
#[tokio::main]
async fn main() -> Result<()> {
let (archive_version, archive) = get_archive(&LATEST).await?;
let out_dir = std::env::temp_dir();
extract(&archive, &out_dir).await
}
§Synchronous API
#[cfg(feature = "blocking")] {
use postgresql_archive::LATEST;
use postgresql_archive::blocking::{extract, get_archive};
let (archive_version, archive) = get_archive(&LATEST).unwrap();
let out_dir = std::env::temp_dir();
let result = extract(&archive, &out_dir).unwrap();
}
§Feature flags
postgresql_archive uses [feature flags] to address compile time and binary size uses.
The following features are available:
Name | Description | Default? |
---|---|---|
blocking | Enables the blocking API | No |
§Supported platforms
postgresql_archive supports all platforms provided by theseus-rs/postgresql-binaries:
OS | Target |
---|---|
Linux | aarch64-unknown-linux-gnu |
Linux | aarch64-unknown-linux-musl |
Linux | arm-unknown-linux-gnueabi |
Linux | arm-unknown-linux-gnueabihf |
Linux | arm-unknown-linux-musleabi |
Linux | arm-unknown-linux-musleabihf |
Linux | armv5te-unknown-linux-gnueabi |
Linux | armv7-unknown-linux-gnueabihf |
Linux | armv7-unknown-linux-musleabihf |
Linux | i586-unknown-linux-gnu |
Linux | i586-unknown-linux-musl |
Linux | i686-unknown-linux-gnu |
Linux | i686-unknown-linux-musl |
Linux | mips64-unknown-linux-gnuabi64 |
Linux | powerpc64le-unknown-linux-gnu |
Linux | powerpc64le-unknown-linux-musl |
Linux | s390x-unknown-linux-gnu |
Linux | s390x-unknown-linux-musl |
Linux | x86_64-unknown-linux-gnu |
Linux | x86_64-unknown-linux-musl |
MacOS | aarch64-apple-darwin |
MacOS | x86_64-apple-darwin |
Windows | x86_64-pc-windows-msvc |
§Safety
This crate uses #![forbid(unsafe_code)]
to ensure everything is implemented in 100% safe Rust.
§License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
PostgreSQL is covered under The PostgreSQL License.
§Notes
Uses PostgreSQL binaries from theseus-rs/postgresql-binaries.
Modules§
Structs§
- PostgreSQL version struct. The version is a simple wrapper around a string. Actively supported major versions of PostgreSQL are defined as constants. The oldest supported version is will be marked as deprecated. Deprecated versions will be removed in a future release following semver conventions for this crate.
Enums§
- PostgreSQL archive errors
Constants§
- The latest PostgreSQL version
- V12DeprecatedThe latest PostgreSQL version 12
- The latest PostgreSQL version 13
- The latest PostgreSQL version 14
- The latest PostgreSQL version 15
- The latest PostgreSQL version 16
Functions§
- Gets the version of PostgreSQL for the specified version. If the version minor or release is not specified, then the latest version is returned. If a release for the version is not found, then a ReleaseNotFound error is returned.
Type Aliases§
- PostgreSQL archive result type